
public class StudentBizz {
	String[] names=new String[30];
	public void addName(String name){
		for (int i = 0; i < names.length; i++) {
			if(names[i]==null){
				names[i]=name;
				break;
			}
		}
	}
	public boolean delName(String name){
		int index=searchName(name);
		if(index!=-1){
			int i;
			for ( i = index; i < names.length-1&&names[i]!=null; i++) {
				names[i]=names[i+1];
				
			}
			names[i]=null;
			return true;
		}
		return false;
		
	}
	public void showName(){
		for (int i = 0; i < names.length; i++) {
			if(names[i]!=null){
				System.out.println(names[i]+" ");
			}
		}
		System.out.println();
	}
	public int searchName(String name){
		for (int i = 0; i < names.length; i++) {
			if(names[i]!=null&&names[i].equals(name)){
				return i;
			}
		}
		return -1;
	}
	public boolean modifyName(String oldName,String newName){
		int index=searchName(oldName);
		if(index!=-1){
			names[index]=newName;
			return true;
			
		}
		return false;
		
	}
	public static void main(String[] args) {
			StudentBizz sb1=new StudentBizz();
			
			sb1.addName("zhangsan");
			sb1.addName("lisi");
			sb1.addName("wangwu");
			sb1.addName("zhaoliu");
			sb1.showName();

			
			sb1.delName("zhaoliu");
			sb1.delName("lisi");
			sb1.delName("wangwu");
			sb1.showName();
	}
	

}
